//使用qs将请求从参数转化位字符串

import qs from "qs";

export default function ({
  $axios,
  redirect
}) {

  $axios.onRequest(config => {

    config.data = qs.stringify(config.data, {

      allowDots: true

    });

    return config;

  });

  $axios.onResponse(response => {

    return Promise.resolve(response.data);

  });

  $axios.onError(error => {

    return Promise.reject(error);

  });

}
